package com.global.college.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.global.college.ui.fragment.ScreenSlidePageFragment
import java.util.*

/**
 * Author by xuyangsheng,  Date on 2024/7/15.
 * Explain：
 */
class ScreenSlidePagerAdapter(
    private val fragmentList: ArrayList<Fragment>,
    fm: FragmentManager
) : FragmentStatePagerAdapter(fm) {

    override fun getCount(): Int = fragmentList.size

    override fun getItem(position: Int): Fragment {
        if (position >= 0 && position < fragmentList.size)
            return fragmentList[position]
        return ScreenSlidePageFragment()
    }
}